<?php
class HTML{
    public static function makeList($image,$title,$desc,$info){
        $title=str_replace('"', '', $title);
        $desc=str_replace('"', '', $desc);
        $info=str_replace('"', '', $info);
        if(mb_strlen($title,'utf-8')>11){
            $title=mb_substr($title,0,11,'utf-8').'...';
        }
        if(mb_strlen($desc,'utf-8')>15 && strpos($desc, '—')!=10){
            $desc=mb_substr($desc,0,15,'utf-8').'...';
        }
        $str.='<div class="group" onclick="popup(\''.$info.'\');">';
        $str.='<div class="left"><img class="logo" src="images/'.$image.'"></div>';
        $str.='<div class="center">';
        $str.='<div class="title">'.$title.'</div>';
        $str.='<div class="content">'.$desc.'</div>';
        $str.='</div>';
        $str.='<div class="right"><img class="more" src="images/more.png"></div>';
        $str.='</div>';
        return $str;
    }

     public static function makeList2($image,$title,$desc,$url){
        $title=str_replace('"', '', $title);
        $desc=str_replace('"', '', $desc);
        $info=str_replace('"', '', $info);
        if(mb_strlen($title,'utf-8')>11){
            $title=mb_substr($title,0,11,'utf-8').'...';
        }
        if(mb_strlen($desc,'utf-8')>15){
            $desc=mb_substr($desc,0,15,'utf-8').'...';
        }
        $str.='<div class="group" onclick="url(\''.$url.'\');">';
        $str.='<div class="left"><img class="logo" src="images/'.$image.'"></div>';
        $str.='<div class="center">';
        $str.='<div class="title">'.$title.'</div>';
        $str.='<div class="content">'.$desc.'</div>';
        $str.='</div>';
        $str.='<div class="right"><img class="more" src="images/more.png"></div>';
        $str.='</div>';
        return $str;
    }

    public static function makeList3($title1,$title2){
        $title22=$title2;
        $title1=str_replace('"', '', $title1);
        $title2=str_replace('"', '', $title2);
        if(mb_strlen($title2,'utf-8')>15 && !is_numeric($title2)) {
            $title2=mb_substr($title2,0,15,'utf-8').'...';
        }
        $str.='<div class="group" onclick="popup(\''.$title22.'\');">';
        $str.='<div class="title1">';
        $str.=$title1;
        $str.='</div>';
        $str.='<div class="title2">';
        $str.=$title2;
        $str.='</div>';
        $str.='</div>';

        return $str;
    }

     public static function makeList4($title1,$title2){
        $title1=str_replace('"', '', $title1);
        $title2=str_replace('"', '', $title2);
        $str.='<div class="group1">';
        $str.='<div class="title1">';
        $str.=$title1;
        $str.='</div>';
        $str.='<div class="title22">';
        $str.=$title2;
        $str.='</div>';
        $str.='</div>';

        return $str;
    }

    public static function makeListNULL($info){
        $str.='<div class="group">';
        $str.='<div class="msg">'.$info.'</div>';
        $str.='</div>';
        return $str;
    }

    public static function makeFooterButton($url,$title){
        $str.='<div class="group">';
        $str.='<div class="msg"><a href="'.$url.'">'.$title.'</a></div>';
        $str.='</div>';
        return $str;
    }
}
?>